import com.hankcs.hanlp.suggest.Suggester;
import hanlp.MySuggester;

import java.util.List;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;

/**
 *
 * 日常测试
 *
 * Created by Zhou_Bing on 2018/12/16.
 */
public class Test {

    public static void main(String[] args) {

        String ss = "定时信号时序图,高频激励时序图,高频起始时序图,\n" +
                ",3A4外观,3A5外观,\n" +
                ",3A4面板功能、位置关系及线缆连接,3A5面板功能、位置关系及线缆连接,\n" +
                ",3A4信号流程14,3A4组成14,3A4电原理图14,\n" +
                ",3A4信号流程,3A4组成,3A4电原理图,\n" +
                ",3A5信号流程,3A5组成,3A5电原理图,\n" +
                ",3A5窄脉波形,\n" +
                ",3A5宽脉波形,\n" +
                ",3A5输出包络,\n" +
                ",3A4原理,3A4原理图,\n" +
                ",3A4A1电源,\n" +
                ",3A5信号流程14,3A5组成14,3A5电原理图14,\n" +
                ",3A4电缆,3A4电缆连接,\n" +
                ",3A4诊断,3A4诊断流程,3A4维修流程,\n" +
                ",3A4功率低故障树,\n" +
                ",3A4+8V故障树,\n" +
                ",3A4+40V故障树,\n" +
                ",3A4A1关键点波形,3A4A1时序,\n" +
                ",3A4A1+8V波形,\n" +
                ",3A5原理,3A5原理图,\n" +
                ",3A5A1原理,3A5A1原理图,\n" +
                ",3A5A1组成图,\n" +
                ",3A5电缆,3A5电缆连接,\n" +
                ",3A5A1+U1波形,\n" +
                ",3A5A1延时输出,3A5A1脉宽调整输出,\n" +
                ",3A5A1延时输出,3A5A1脉宽调整输出,\n" +
                ",3A5A1开关管驱动,3A5A1开关管驱动信号,3A5A1开关管驱动波形,\n" +
                ",3A5开关管1,3A5开关管1驱动信号,3A5开关管1驱动波形,\n" +
                ",3A5开关管2,3A5开关管2驱动信号,3A5开关管2驱动波形,\n" +
                ",3A5A1关键点波形,3A5A1时序,\n" +
                ",3A5输出波形,\n" +
                ",高频放大链调试框图,高频放大链调试设备连接,\n" +
                ",3A4+3A5调试框图,3A4+3A5调试设备连接,\n" +
                ",高频放大链诊断,高频放大链诊断流程,高频放大链维修流程,\n" +
                ",3A5诊断,3A5诊断流程,3A5维修流程,\n" +
                ",3A5输出包络异常故障树,3A5输出功率低故障树,\n" +
                ",定时信号与其他信号波形,定时信号与其他信号时序,\n" +
                ",系统声明,友情提示,\n" +
                ",\n" +
                ",用户反馈,反馈意见,建议,\n" +
                ",无回波信号,输出功率异常,回波面积变小,输出包络波形不正常,486,533,209,210,\n" +
                ",\n" +
                ",常见报警信息,常见故障现象,\n" +
                ",功率计使用方法,\n" +
                ",高频放大链组成,\n" +
                ",高频整件调试框图,\n" +
                ",高频放大链功能,高频放大链工作原理,\n" +
                ",高频放大链故障定位技巧,\n" +
                ",高频放大链故障定位方法,\n" +
                ",3A4安装,固态放大器安装,\n" +
                ",3A4拆卸,固态放大器拆卸,\n" +
                ",3A5安装,射频脉冲形成器安装,\n" +
                ",3A5拆卸,射频脉冲形成器拆卸,\n" +
                ",3A5后级单元诊断方法,速调管及其相关电路诊断方法,\n" +
                ",3A4诊断方法,3A4故障定位方法,3A4外部信号检查,\n" +
                ",RF射频输入信号检查,\n" +
                ",高频激励触发信号检查,\n" +
                ",+40V电源检查,\n" +
                ",3A4基础知识,\n" +
                ",固态放大器组成,高频激励器组成,射频激励器组成,\n" +
                ",3A4外观形式,\n" +
                ",3A4功能,\n" +
                ",3A4技术要求,\n" +
                ", 3A4高频放大原理,3A4工作原理,\n" +
                ",3A4电源,3A4同步控制,3A4供电,\n" +
                ",3A4采样检测,\n" +
                ",3A4典型故障案例集,\n" +
                ",典型案例——发射机不可操作,\n" +
                ",典型案例——回波面积明显缩小,\n" +
                ",典型案例——无回波信号,\n" +
                ",3A4功放A1检查,\n" +
                ",3A4功放A3检查,\n" +
                ",3A4输出端隔离器检查,3A4输出端定向耦合器检查,\n" +
                ",3A4二级功放电源检查,\n" +
                ",3A4一级功放电源检查,\n" +
                ",3A4A1振荡电路检查,\n" +
                ",3A4+8V调制脉冲检查,\n" +
                ",3A4+8V调制脉冲外围电路检查,\n" +
                ",3A5基础知识,\n" +
                ",射频脉冲形成器,高频脉冲形成器,脉冲形成器组件,\n" +
                ",3A5外观形式,\n" +
                ",3A5功能,\n" +
                ",3A5技术要求,\n" +
                ",3A5脉冲调制,3A5相位补偿,\n" +
                ",3A5A1工作原理,\n" +
                ",3A5输出采样检测,\n" +
                ",3A5诊断方法,3A5故障定位方法,3A5外部信号检查,\n" +
                ",3A5内部故障检查,3A5内部故障诊断与定位,\n" +
                ",3A5调制器W2检查,\n" +
                ",3A5功率合成器E4检查,\n" +
                ",3A5调制器驱动器D8检查,\n" +
                ",3A5调制器驱动器D7检查,\n" +
                ",脉冲延时和脉宽调整工作控制信号检查,\n" +
                ",脉冲延时和脉宽调整器件检查,\n" +
                ",光耦及反相器检查,\n" +
                ",在线支持,求助,HELP,帮我,学习,帮助,请教,\n" +
                ",高频起始触发信号检查,\n" +
                ",3A4关键点波形,3A4时序,\n" +
                ",3A4A1调试方法(敏视达),\n" +
                ",3A5调试方法(敏视达),\n" +
                ",3A5A1调试方法(14所),航模";

        String[] titles = ss.replaceAll("\n","").split(",");

        Suggester suggester = new Suggester();
        MySuggester mySuggester = new MySuggester();
        for (String title : titles)
        {
            suggester.addSentence(title);
            mySuggester.addSentence(title);
        }

//        List<String> results = suggester.suggest("3A4", 10);


        System.out.println(suggester.suggest("3A4", 10));
        System.out.println(mySuggester.suggest("3A4", 10));
    }
}
